import java.util.LinkedList;
import java.util.List;

public class Entry {

	/**
	 * @param Main entry of the program.
	 * 	
	 */
	
	
	// global configs and data about the cuurent curators.
	public static String key = "cogcomp";
	public static String password = "password";
	public static List<CuratorPS> curatorList = new LinkedList<CuratorPS>();

	public static void main(String[] args) {

		int port = 4567;
		//default port number config

		
		//if user forget to input an port number ,use default one.
		try {
			port = Integer.parseInt(args[0]);
		} catch (Exception e) {
			System.err.println("wrong args, Use Default 4567 port");

		}
		
		
		//read the config file get the list of(JavaTools and NonJavaTools)
		curatorList = Util.getCuratorList();
		password = Util.getPassWD();
		
		//Tell user what the password is.
		TextIO.putln("Password is " + password);

		
		//Start the deamon process, which change the keyURL  every 30 min.
		Deamon dea = new Deamon();
		dea.setDaemon(true);
		dea.start();
		System.out.println("isDaemon = " + dea.isDaemon());

		
		// Start the server.
		Service main = new Service(port);
		main.start();
		while (true) {
			int i = 0;
		}

	}
}
